﻿using UnityEngine;
using QFramework;

namespace HKTools
{
    public class HK_FirstPersonTrigger : HKFirstPersonCam_BaseController
    {
        [Header("触发器分组："), SerializeField] public FirstPersonTriggerGroupEnum triggerGroup;

        [Header("触发器类型："), SerializeField, FirstPersonTriggerUnique] public FirstPersonTriggerEnum triggerType;

        [Header("是否单次触发？"), SerializeField] public bool isOnceTrigger;

        void Awake()
        {
            if (GetComponent<Collider>() == null)
            {
                HKDebug.LogError("HK_FirstPersonTrigger 组件需要挂载 Collider 组件！");
            }

            this.GetSystem<IHK_FirstPersonCamSystem>().InitCamTriggerList(this);
        }

        void OnDestroy()
        {
            this.GetSystem<IHK_FirstPersonCamSystem>().RemoveFromCamTriggerList(this);
        }
    }
}

